/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gallonsinwell;
import java.util.Scanner;
/**
 *
 * @author smiththa
 */
public class GallonsInWell {

    /**
     * A sample program to run the gallons in the well question
     */
    public static final double PI = 3.14; //or any number of decimal places
    
    public static void main(String[] args) {
         System.out.println("This program will allow the user to input values for the radius in inches,");
         System.out.println(" and the depth in feet, and will calculate the number of gallons");
         
         Scanner keyboard = new Scanner (System.in);
         double radius, depth;
         System.out.print("Please enter the radius in inches ");//prompt the user
         radius = keyboard.nextDouble();
         System.out.println(); //new line
         System.out.print("Please enter the depth in feet "); //prompt the user
         depth = keyboard.nextDouble();
         System.out.println();
         
         
         radius = radius / 12; //convert inches to feet
                 
         double volume;
         volume = PI * radius * radius * depth; //calculates the volume in cubic feet
         
         double gallons;
         gallons = volume * 7.48;
         
         System.out.printf("The number of gallons to 2 decimal places is %1.2f", gallons); 
          
    }
    
}
